Win-Emacs is a version of the popular GNU Emacs programming editor
that runs under Microsoft Windows. Win-Emacs requires Windows 3.1
running on a machine with a 386 or better processor and at least 6
megabytes of memory. 9 megabytes of free hard-disk space is required
for a complete distribution.
Win-Emacs also includes full 32-bit ports of the GNU versions of the
popular Unix utilities grep, diff, and patch.
GNU Emacs is a powerful, customizable programming editor that is also
available on nearly every variety of Unix, on Vax VMS, and on most other
operating systems. Win-Emacs is a complete implementation of GNU Emacs,
meaning that the features you may be used to in other versions of GNU
Emacs will be present in Win-Emacs.
Win-Emacs is based on Lucid GNU Emacs 19.6 (now called XEmacs),
which is a version of GNU Emacs that provides extensive windowing and
GUI (graphical user interface) features and runs under Unix on the X
Window System. Although there are other windowing versions of GNU
Emacs, Lucid Emacs is the most powerful and best-designed, and is the
only version supported by large software companies (Sun Microsystems
Inc., Amdahl, and others); this is why we chose to base Win-Emacs on it.
This manual assumes that you have some knowledge of how to use some
version of Emacs (although not necessarily a windowing version). If
you are unfamiliar with Emacs, choose the `Emacs Tutorial' option from
the `Help' menu for a quick introduction to editing with Emacs.
This manual is available both as a printed document and on-line, by
choosing the `Info' option from the `Help' menu and selecting
`Win-Emacs'. There is also extensive on-line reference documentation
describing Win-Emacs, E-Lisp (the dialect of the Lisp language that is
used to customize Win-Emacs), and various associated packages.
If, after reading this manual, you have further questions or comments
about Win-Emacs, feel free to contact Pearl Software (*note Contacting
Pearl Software::.).
File: winemacs, Node: Getting Started, Next: Overview of Win-Emacs, Prev: Introduction, Up: Top
Getting Started
***************
This chapter explains how to install Win-Emacs on your system and
get it up and running.
* Menu:
* Installation::
* Configuring Your System for Win-Emacs::
* Running Win-Emacs::
File: winemacs, Node: Installation, Next: Configuring Your System for Win-Emacs, Up: Getting Started
Installation
============
* If you received Win-Emacs on floppies:
Installation is accomplished through the `SETUP.EXE' program
located on the disk `Win-Emacs 1' in the distribution. Insert this
disk in drive A and type `A:SETUP' from a DOS prompt; or from
within Windows, select the `Run' command from the `File' menu in
Program Manager and type `A:SETUP.EXE'. Setup will start Windows
automatically if it is not currently running, and will allow you to
select the sections of Emacs you wish to install. The "Core
Program Files" must be installed in order for Emacs to work. This
includes the binaries, compiled Emacs-Lisp files, and files in the
`etc' subdirectory. "Emacs Info" refers to the online
documentation files; you may choose not to install these files if
you wish.
* If you downloaded a demo version by FTP or off of a CD-ROM:
You will need to unpack the files from whatever form they are in.
If they are in a `.ZIP' file, this file should be unpacked using
`PKUNZIP -d'. (The `-d' option is important - it creates the
necessary subdirectories.) You need to use version 2.0 or greater
of `PKUNZIP'. If the files have already been unpacked, you simply
need to copy them into the proper location (e.g. using `XCOPY'),
making sure to preserve the subdirectory structure. If there is
not already a subdirectory `LOCK' off of the top-level directory,
you must create it.
File: winemacs, Node: Configuring Your System for Win-Emacs, Next: Running Win-Emacs, Prev: Installation, Up: Getting Started
Configuring Your System for Win-Emacs
=====================================
* Menu:
* Setting Up Your Path:: May not be necessary.
* Increasing Your Virtual Memory:: Highly recommended.
* Specifying the Location of Startup Files:: Optional.
File: winemacs, Node: Setting Up Your Path, Next: Increasing Your Virtual Memory, Up: Configuring Your System for Win-Emacs
Setting Up Your Path
--------------------
If you plan on using the utilities `etags', `grep', `diff', or
`patch' from MS-DOS or from a DOS box inside of Windows, you need to
add the `etc' subdirectory (for example, `c:\winemacs\etc' if you
installed Win-Emacs in `c:\winemacs') to your PATH (usually specified
in your `AUTOEXEC.BAT' file). Note that you do not have to do this if
you only use these utilities from inside Win-Emacs: it knows how to
find them regardless of your PATH.
Your PATH cannot be longer than 128 characters; if this becomes a
problem, one trick is to use the MS-DOS `SUBST' command. For example,
if `H:' does not refer to an existing drive, add a line like
subst h: c:\winemacs\etc
to your `AUTOEXEC.BAT' file, and then add `H:\' to your PATH. This
same trick can be used multiple times (with different drive letters, of
course) to reduce the length of your PATH. Note that you may have to
add a line like
lastdrive=h
to your `CONFIG.SYS' file. See your MS-DOS manual for details.
File: winemacs, Node: Increasing Your Virtual Memory, Next: Specifying the Location of Startup Files, Prev: Setting Up Your Path, Up: Configuring Your System for Win-Emacs
Increasing Your Virtual Memory
------------------------------
Win-Emacs uses a fair amount of memory in normal operation and does
not perform well in low-memory conditions. We recommend that you have
at least 20 megabytes of virtual memory. (Note that this does *not*
mean that you actually need this much RAM in your system! A normal
amount like 8 megabytes of RAM should do.)
To increase the amount of virtual memory, go into Control Panel and
select the `386 Enhanced' icon; then click on the button labeled
`Virtual Memory'.
File: winemacs, Node: Specifying the Location of Startup Files, Prev: Increasing Your Virtual Memory, Up: Configuring Your System for Win-Emacs
Specifying the Location of Startup Files
----------------------------------------
You can specify the directory where Win-Emacs looks for startup
files by setting the environment variables `EMACSHOME' or `HOME'. (If
neither is set, Win-Emacs looks in `C:\'.) For more info, *Note
Initialization Files::.
File: winemacs, Node: Running Win-Emacs, Prev: Configuring Your System for Win-Emacs, Up: Getting Started
Running Win-Emacs
=================
Once Win-Emacs has successfully been installed, you can run it in
any of the following ways:
1. From File Manager, locate the file `WINEMACS.EXE' (this is in the
`bin' subdirectory of the directory you installed Win-Emacs in).
Double-click on it to run.
2. From Program Manager, select `Run' from the File menu and type in
the full pathname of `WINEMACS.EXE' (see option 1).
3. In Program Manager, create a program item and give the full
pathname of `WINEMACS.EXE' as the command line. You may
optionally specify a directory that will be current when Win-Emacs
starts; this is the default directory when Win-Emacs searches for
files. If you do not specify a current directory, the Windows
directory will be current.
File: winemacs, Node: Overview of Win-Emacs, Next: More About Win-Emacs, Prev: Getting Started, Up: Top
Overview of Win-Emacs
*********************
* Menu:
* Using the Keyboard::
* Using the Mouse::
* Using the Menus::
* Dialog Boxes::
* Creating and Managing Multiple Screens::
File: winemacs, Node: Using the Keyboard, Next: Using the Mouse, Up: Overview of Win-Emacs
Using the Keyboard
==================
Emacs was originally designed for use on character-mode terminals,
which lacked menus and mice and often had no arrow or keypad keys;
thus, it is completely controllable from the main portion of the
keyboard. However, you will probably find it easier to make use of the
keypad, mouse, and menus.
For an introduction to how to control Emacs with the Keyboard, choose
the `Emacs Tutorial' option from the `Help' menu.
The following keypad key combinations are defined:
*Movement Keys:*
`Left', `Right'
Move backward or forward by one character.
`Ctrl-Left', `Ctrl-Right'
Move backward or forward by one word.
`Meta-Left', `Meta-Right'
Move backward or forward by one balanced expression or word.
`Up', `Down'
Move up or down by one line.
`Ctrl-Up', `Ctrl-Down'
Move up or down by one block (the definition of this is
mode-dependent).
`Meta-Up', `Meta-Down'
Move backward or forward by one balanced group of parentheses.
`PageUp', `PageDn'
Move up or down one page.
`Meta-PageUp', `Meta-PageDn'
Scroll the other window up or down one page.
`Home', `End'
Move to the beginning or end of the line.
`Ctrl-Home', `Ctrl-End'
Move to the beginning or end of the buffer.
`Meta-Home', `Meta-End'
Move to the beginning or end of the other window's buffer.
*Text Deletion/Insertion Keys:*
`BackSpace', `Delete'
Delete the character before or after (at) point.
`Meta-BackSpace', `Meta-Delete'
Delete the word before or after point.
`Shift-Delete'
Equivalent to the `Cut' menu item.
`Control-Insert'
Equivalent to the `Copy' menu item.
`Shift-Insert'
Equivalent to the `Paste' menu item.
`Control-Delete'
Equivalent to the `Clear' menu item.
*Other Keys:*
`Ctrl-Tab', `Ctrl-Shift-Tab'
Switch to the next or previous window in this screen.
`Insert'
Toggle between insert and overwrite mode.
File: winemacs, Node: Using the Mouse, Next: Using the Menus, Prev: Using the Keyboard, Up: Overview of Win-Emacs
Using the Mouse
===============
* Menu:
* The Left Mouse Button:: Position the cursor and select text.
* The Middle Mouse Button:: Copy text (only on a three-button mouse).
* The Right Mouse Button:: Bring up a popup menu.
* Drag-and-Drop:: File Manager integration.
* Remapping the Pointer:: Switching around the pointer buttons.
File: winemacs, Node: The Left Mouse Button, Next: The Middle Mouse Button, Up: Using the Mouse
The Left Mouse Button
---------------------
The left mouse button is used to set the insertion point, select
text to be operated on (e.g. cut or copied to the clipboard,
reformatted, etc.), and perform actions associated with a highlighted
block of text. The gestures that can be performed using the mouse are
"clicking" (pressing and releasing the button without moving the mouse),
"double-clicking" and "triple-clicking" (rapidly clicking the button
twice or three times in succession without moving the mouse),
"dragging" (pressing the button, moving the mouse while the button is
held down, and then releasing the button), and "double-dragging" and
"triple-dragging" (like double-clicking and triple-clicking except that
a drag is performed before the final release of the mouse button).
Clicking anywhere in the text normally sets the insertion point
before the character that was clicked on (or at the end of a line if
the click occurred beyond the end of a line), and a block cursor marks
the location of the insertion point. However, clicking on a highlighted
block of text (e.g. a cross-reference in Info or a completion in the
completion buffer) performs the action associated with the text (e.g.
following the cross reference or selecting a completion). In this
context, "highlighted" means that the block of text is momentarily
highlighted (typically by turning green) when the mouse passes over it.
This should not be confused with the less transient sort of highlighting
that occurs when you select a block of text by dragging the mouse over
it. (This is usually indicated by marking the text gray.) Note that, if
you just want to set the insertion point in the middle of a highlighted
block of text, hold down the `Control' key when clicking; this
overrides any action that is associated with the text.
Here is a list of common sorts of highlighted text that have actions
associated with them.
* A cross-reference in Info.
* A possible completion in the `*Completions*' buffer, when you hit
`Tab' or `Space' in the minibuffer.
* A file or directory in Dired.
* A compilation error or searching match, when you use `M-x compile'
or `M-x grep'.
* A buffer in buff-menu (a listing of current buffers that is
displayed using `C-x C-b').
Dragging the mouse over a block of text selects the text, and
normally unselects any other text that may be selected. However,
holding down the Shift key when clicking or dragging first causes the
old selected text (if any) and all text between the previous insertion
point and the current mouse location to become part of the new
selection. This is called "Extending a Selection" and is commonly used
as a way of selecting text without having to drag the mouse.
Double-clicking is a short-cut gesture that selects the word that
surrounds or abuts the cursor; similarly, triple-clicking selects a
line. Double-dragging and triple-dragging select text a word at a time
or a line at a time. These latter gestures are often forgotten about,
but can make selecting text much easier.
If there is more than one window on a screen, pressing the mouse
button while over a modeline and then dragging causes the modeline to
get dragged, thereby resizing the windows.
File: winemacs, Node: The Middle Mouse Button, Next: The Right Mouse Button, Prev: The Left Mouse Button, Up: Using the Mouse
The Middle Mouse Button
-----------------------
On a three-button mouse, pressing the middle mouse button while some
text is selected causes the selected text to be copied and inserted at
the current mouse position.
Pressing the middle mouse button on a highlighted block of text
normally causes the action associated with the text to be performed,
just as if the left mouse button were clicked. (This exists for
compatibility reasons.)
If you have a two-button mouse, the same functionality as the middle
mouse button is available by holding down the `Meta' (i.e. `Alt') key
and pressing the right button.
File: winemacs, Node: The Right Mouse Button, Next: Drag-and-Drop, Prev: The Middle Mouse Button, Up: Using the Mouse
The Right Mouse Button
----------------------
The right mouse button normally brings up a popup menu at the current
mouse position. The contents of the popup menu are dependent on the
mode of the current buffer and usually contain commonly used commands
for easy access.
Holding down the `Meta' key while pressing the right mouse button is
equivalent to pressing the middle mouse button (see the previous
section for details).
File: winemacs, Node: Drag-and-Drop, Next: Remapping the Pointer, Prev: The Right Mouse Button, Up: Using the Mouse
Drag-and-Drop
-------------
You can drag files from the File Manager and drop them onto a
Win-Emacs screen. For each file dropped, a new screen will be created
that is visiting that file.
File: winemacs, Node: Remapping the Pointer, Prev: Drag-and-Drop, Up: Using the Mouse
Remapping the Pointer
---------------------
Win-Emacs doesn't actually think in terms of left, middle, and right
buttons, but in terms of "button1", "button2", and "button3". By
default, button1 is the left button, button2 is the middle one, and so
on; this results in the behavior described above. However, you can
change these associations using the `xmodmap.ini' file. For example,
you could make button2 be the right button and button3 be the middle
one, and then pressing the middle button would bring up a pop-up menu
and pressing the right one would insert the selected text at the
current mouse position. For details, *Note xmodmap.ini::.
File: winemacs, Node: Using the Menus, Next: Dialog Boxes, Prev: Using the Mouse, Up: Overview of Win-Emacs
Using the Menus
===============
Win-Emacs has a menubar that behaves like any other Windows menubar.
It contains the most common editing commands for easy access. The
contents of the menubar can vary from buffer to buffer, and will change
when you switch buffers; usually this variation consists of extra
buffer-specific commands in some modes (e.g. W3 menus when you are in
W3 mode).
Keyboard traversal using Alt in combination with letter keys is
disabled because Alt is the same as Meta and is used for many keyboard
commands. However, you can still traverse to the menu with the
keyboard by pressing and releasing the Alt key without any intervening
keystrokes.
Win-Emacs also has popup menus that are accessible by pressing the
right mouse button (*note The Right Mouse Button::.).
The menubar and popup menus are fully programmable. For details,
see the documentation for the E-Lisp variable `current-menubar' and the
functions `popup-menu' and `popup-mode-menu'. If you want to turn off
the menubar, use the E-Lisp command `(set-menubar nil)'.
File: winemacs, Node: Dialog Boxes, Next: Creating and Managing Multiple Screens, Prev: Using the Menus, Up: Overview of Win-Emacs
Dialog Boxes
============
Win-Emacs currently has dialog boxes for changing the font of the
screen and controlling printing. These are accessible from the `Set
Font...' option on the `Display' menu and the `Print...' and `Print
Setup...' options on the `File' menu.
File: winemacs, Node: Creating and Managing Multiple Screens, Prev: Dialog Boxes, Up: Overview of Win-Emacs
Creating and Managing Multiple Screens
======================================
Multiple windows ("screens" in Win-Emacs terminology) can be created
by typing `C-x 5' or selecting `New Screen' from the `File' menu, and
can be resized, moved around, and iconified independently from all
other screens. You can also create a new screen that is visiting a
particular file by choosing `Open File in New Screen' from the `File'
menu. Closing a screen using the system menu in the upper-left corner
of the screen will delete the screen if there is more than one, and
quit Win-Emacs if there is only one screen. You can also use the
`Delete Screen' item on the `File' menu if there is more than one
screen.
File: winemacs, Node: More About Win-Emacs, Next: Other Packages, Prev: Overview of Win-Emacs, Up: Top
More About Win-Emacs
********************
* Menu:
* Printing:: Accessing the printer.
* Syntax Highlighting:: Making your code easier to read.
* Subprocesses:: Running other programs from Win-Emacs.
* Network Connections:: Accessing other machines.
* DDE Support:: Communicating with other programs.
* Editing Binary Files:: Editing .EXE files, .PIF files, etc.
* Editing Files in Hex Mode:: Editing in traditional hex-dump mode.
* MS-DOS Filenames:: Filenames under MS-DOS have limitations.
* Low-Level PC Functions:: Violating the integrity of the system.
File: winemacs, Node: Printing, Next: Syntax Highlighting, Up: More About Win-Emacs
Printing
========
Full WYSIWYG ("what you see is what you get") printing support and
integration with Print Manager is provided. Standard Print and Print
Setup dialog boxes are provided to facilitate printer control; these are
available from the `Print...' and `Print Setup...' options on the
`File' menu or from the commands `M-x lpr-buffer' and `M-x lpr-region'.
* Menu:
* Notes About Printing:: Subtleties about printing are explained.
* Printing Variables:: Controlling the appearance of printed output.
* Printing Functions:: Accessing the printer from E-Lisp.